<template>
	<view class="hui">
		<view class="head b_flex_c">
			<image class="img" :src="user.avatar"></image>
			<view>
				<view>{{user.nickname}}</view>
				<view class="msg">
					<text>{{user.mobile}}</text>
					<text class="group">{{user.group}}</text>
				</view>
			</view>
		</view>
		
		<view class="box">
			<view class="boxs">
				
				<view class="b_flex_c_s input_box" @click="$project.toPath('/pages/user/info')">
					<view>城市仓信息</view>
					<view class="b_flex_c">
						<view>{{user.fc.name}}</view>
						<u-icon class="" name="arrow-right" color="#2F2F2F" size="16"></u-icon>
					</view>
				</view>
				
				<view class="b_flex_c_s input_box" v-if="user.group_id==1" @click="$project.toPath('/pages/user/yuan')">
					<view>员工管理</view>
					<view class="b_flex_c">
						<u-icon class="" name="arrow-right" color="#2F2F2F" size="16"></u-icon>
					</view>
				</view>
				
				<view class="b_flex_c_s input_box" @click="$project.toPath('/pages/user/set')">
					<view>设置</view>
					<view class="b_flex_c">
						<u-icon class="" name="arrow-right" color="#2F2F2F" size="16"></u-icon>
					</view>
				</view>
				
			</view>
		</view>
		
	</view>
</template>

<script>
	import {
		userInfo
	} from '@/require/api';
	export default{
		data(){
			return{
				user: '',
			}
		},
		methods:{
			async getUserInfo() {
				let {
					data,
					code
				} = await userInfo();
				if (code == 1) {
					this.user = data;
				}
			},
		},
		onShow() {
			this.getUserInfo();
		}
	}
</script>

<style scoped lang="scss">
	
	.head{
		background-color:#F2F6FF;
		box-sizing: border-box;
		padding: 0 0 100rpx 25rpx;
	}
	
	.img{
		width: 110rpx;
		height: 110rpx;
		border-radius: 50%;
		margin-right: 20rpx;
	}
	
	.msg{
		color: #9A9FA5;
		font-size: 28rpx;
		margin-top: 15rpx;
	}
	
	.group{
		margin-left: 15rpx;
	}
	
	.box{
		box-sizing: border-box;
		padding: 20rpx;
		position: relative;
		top:-90rpx;
	}
	
	.boxs{
	    background-color: white;
		box-sizing: border-box;
		padding: 20rpx;
		border-radius: 15rpx;
		font-size: 29rpx;
	}
	
	.input_box{
		box-sizing: border-box;
		padding: 20rpx 0;
	}
</style>